<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets">
    <h:head>
        <title>TODO supply a title</title>
    </h:head>
    <h:body>
        <ui:composition template="/WEB-INF/templates/commonLayout.xhtml">

            <ui:define name="content">
                <f:view>
                    <h:form id="form">  

                        <p:panel id="panel" header="Registration">  


                            <h:panelGrid styleClass="registrationForm" columns="2" columnClasses="leftColumn,rightColumn" cellpadding="20" cellspacing="4" >
                                <h:outputLabel styleClass="registrationRow" for="name">Login</h:outputLabel> 
                                <p:inputText styleClass="registrationRow" title="Name" id="login" required="true" value="#{registrationBackingBean.userDTO.login}">
                                    <f:validateLength minimum="3" />  
                                </p:inputText>
                                                                
                                <h:outputLabel styleClass="registrationRow" for="email">Email address</h:outputLabel> <p:inputText styleClass="registrationRow" title="Email" id="email" required="true" value="#{registrationBackingBean.userDTO.email}">
                                    <f:validateLength minimum="3" /> 
                                </p:inputText>
                                
                                <h:outputLabel styleClass="registrationRow" for="password1">Password</h:outputLabel> <p:password styleClass="registrationRow" feedback="true" id="password1" required="true" value="#{registrationBackingBean.password}" match="password2">
                                    <f:validateLength minimum="3" />
                                </p:password>
                                
                                <h:outputLabel styleClass="registrationRow" for="password2">Confirmation</h:outputLabel> <p:password styleClass="registrationRow" feedback="true" id="password2" required="true" value="#{registrationBackingBean.password}">
                                    <f:validateLength minimum="3" />
                                </p:password>
                                <p:commandButton   value="Save"  action="#{registrationBackingBean.saveUser}" ajax="false"/>  
                            </h:panelGrid>  

                      
                        </p:panel>  

                    </h:form>  
                </f:view>

            </ui:define>
        </ui:composition>
    </h:body>
</html>
